Why do both [-[]] and [+[]] return [0] in Javascript?
console.log([+[]])
console.log([-[]])
unary + or - operator just converts it operand to a number. Empty array converted to number is 0. So you got the same result for both [+[]] and [-[]].
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus
https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-unary-plus-operator